ACG LINK
Classic Load Balancer (CLB): Overview and Configuration Example
Amazon Classic Load Balancer (CLB) is the traditional load balancing service provided by AWS. It distributes incoming application traffic across multiple targets, such as Amazon EC2 instances, containers, and IP addresses, within one or more availability zones. Unlike Application Load Balancer (ALB) and Network Load Balancer (NLB), CLB operates at the application layer (Layer 7) for HTTP/HTTPS traffic and the transport layer (Layer 4) for other protocols. Here's a detailed overview of Amazon CLB along with a configuration example:
Features of Amazon CLB:
-
Layer 7 Load Balancing (HTTP/HTTPS):
- Operates at the application layer for HTTP and HTTPS traffic, allowing for content-based routing.
- Layer 4 Load Balancing (Other Protocols):
- Operates at the transport layer for non-HTTP/HTTPS protocols.
- Cookie-Based Session Stickiness:
- Supports session stickiness to route requests from the same client to the same target.
- Health Checks:
- Performs health checks on registered targets to ensure they are available to handle traffic.
- Integration with AWS Services:
- Integrates seamlessly with other AWS services, such as Auto Scaling, AWS WAF (Web Application Firewall), and AWS CloudWatch.
- Cross-Zone Load Balancing:
- Distributes traffic evenly across targets in multiple Availability Zones for improved fault tolerance.
Configuration Example:
Let's create a simple Amazon Classic Load Balancer and configure it to distribute HTTP traffic to backend EC2 instances using the AWS Management Console:
-
Login to AWS Console:
- Open EC2 Console:
- Click on the "EC2" service in the console.
- Create EC2 Instances:
- Launch EC2 instances that will serve as backend targets. Ensure they are in the same VPC and security group.
- Open Load Balancer Console:
- Click on the "Load Balancers" section and choose "Create Load Balancer."
- Select Classic Load Balancer:
- Choose "Classic Load Balancer" and click "Create."
- Configure Load Balancer:
- Provide a name for the load balancer.
- Specify the listener configuration, such as the protocol (HTTP or HTTPS) and port (e.g., HTTP on port 80).
- Configure Availability Zones:
- Choose the Availability Zones where you want the load balancer to distribute traffic.
- Configure Health Check:
- Set up a health check to ensure that registered instances are healthy. Configure the ping target and response timeout.
- Configure Security Settings (Optional):
- Optionally, configure security settings, including SSL/TLS termination for HTTPS traffic.
- Configure Additional Settings (Optional):
- Optionally, configure additional settings such as connection draining and cross-zone load balancing.
- Add EC2 Instances to Load Balancer:
- Register EC2 instances with the load balancer. These instances will serve as backend targets.
- Review and Create:
- Review the load balancer configuration and click "Create."
- Monitor Load Balancer Creation:
- Monitor the load balancer creation process in the console until the status becomes "Active."
- Update DNS (Optional):
- If using a custom domain, update DNS settings to point to the DNS name of the load balancer.
- Test Load Balancer:
- Test the load balancer by accessing the DNS name or IP address. Requests should be distributed to the configured target instances.
- Scale and Update Configuration (Optional):
- Optionally, scale the number of EC2 instances in the load balancer or update load balancer configuration as needed.
- Delete Load Balancer (Optional):
- Optionally, you can delete the load balancer through the console if it's no longer needed.